/*
 * Copyright (c) Jiandong.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */


//todo enum
export const enum YogaDimension {
  WIDTH = 0,
  HEIGHT = 1,
}

export function getYogaDimensionFromInt(value: number): YogaDimension | never {
  switch (value) {
    case 0: return YogaDimension.WIDTH;
    case 1: return YogaDimension.HEIGHT;
    default: throw new Error("Unknown enum value: " + value);
  }
}

//export class YogaDimension {
//  public static readonly WIDTH = 0
//  public static readonly HEIGHT = 1
//
//  private readonly mIntValue: number;
//
//  constructor(intValue: number) {
//    this.mIntValue = intValue;
//  }
//
//  public intValue(): number {
//    return this.mIntValue;
//  }
//
//  public static fromInt(value: number): number | never {
//    switch (value) {
//      case 0: return YogaDimension.WIDTH;
//      case 1: return YogaDimension.HEIGHT;
//      default: throw new Error("Unknown enum value: " + value);
//    }
//  }
//}
